package com.yunhe.sms.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * @author LeiPeifeng
 * @version V1.0
 * @date 2017/11/17 0017 11:42
 * @Description:
 */
@Aspect
@Component
public class SystemAspect {

    @Around ( "execution(public * com.yunhe.sms.service..impl.*.*(..))" )
    public Object roung(ProceedingJoinPoint pjd){
        Object result=null;
        System.out.println ("前置通知");
        try {
            result = pjd.proceed ();
            System.out.println ("后置通知");
        } catch (Throwable throwable) {
            System.out.println ("异常通知");
            throwable.printStackTrace ();
        }finally {
            System.out.println ("后置通知");
        }
    return result;
    }
}
